package com.haorui.lygyd.authority.authentication;

import lombok.Getter;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;

/**
 * @author 陈刚
 * @version 1.0
 * @project znsm
 * @package com.haorui.znsm.authority.authentication
 * @createDate 2018-03-16 16:08
 * @modfiyDate
 * @function
 */
public class PermsAuthenticationToken  extends AbstractAuthenticationToken {
    private String tokenHead;
    private String authHeader;
    @Getter
    private HttpServletRequest httpServletRequest;
    public PermsAuthenticationToken(String tokenHead,String authHeader,HttpServletRequest httpServletRequest) {
        super(null);
        this.tokenHead=tokenHead;
        this.authHeader=authHeader;
        this.httpServletRequest=httpServletRequest;
    }

    @Override
    public Object getCredentials() {
        return authHeader;
    }

    @Override
    public Object getPrincipal() {
        return tokenHead;
    }
}
